//
//  StyListSonHeaderView.m
//  PerfectWorld
//
//  Created by dllo on 16/9/6.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "StyListSonHeaderView.h"
#import "Masonry.h"
@implementation StyListSonHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self creatSubView: self.bounds];
    }
    return self;
}

- (void)creatSubView:(CGRect) sender {
    _backGroundImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height * 0.8)];
    _backGroundImage.backgroundColor = [UIColor orangeColor];
    [self addSubview:_backGroundImage];
    _titleImage = [[UIImageView alloc] init];
    _titleImage.layer.cornerRadius = 35;
    [self addSubview:_titleImage];
    [_titleImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo (0);
        make.height.width.mas_equalTo (70);
        make.centerY.mas_equalTo(0);
    }];
    _labelName = [[UILabel alloc]init];
    _labelName.font = [UIFont systemFontOfSize:15];
    _labelName.backgroundColor = [UIColor redColor];
    [self addSubview:_labelName];
    [_labelName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(_titleImage);
        make.width.mas_equalTo (100);
        make.height.mas_equalTo(30);
        make.top.mas_equalTo(_titleImage.mas_bottom).mas_offset(10);
    }];
    UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [leftBtn setTitle:@"加关注" forState:UIControlStateNormal];
    [self addSubview:leftBtn];
//    [leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.right.mas_equalTo(_labelName.mas_leading).mas_offset(0);
//        make.width.mas_equalTo (60);
//        make.height.mas_equalTo(25);
//        make.top.mas_equalTo(_labelName.mas_bottom).mas_offset(10);
//    }];
    UIButton *rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [rightBtn setTitle:@"私信我" forState:UIControlStateNormal];
    [self addSubview:rightBtn];
//    [rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.width.height.top.bottom.mas_equalTo (leftBtn);
//        make.trailing.mas_equalTo(_titleImage.mas_right).mas_offset(0);
//    }];
    
}




@end
